package me.keiwu.user.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by kei on 20/10/2017.
 */
@RestController
@RequestMapping({"/index", ""})
public class IndexController {

    private static final Logger logger = LoggerFactory.getLogger(IndexController.class);

    @RequestMapping("")
    public String index(HttpServletRequest request, HttpServletResponse response) {
        String queryString = request.getQueryString();
        String test = request.getHeader("test");
        Long userId = (Long) request.getAttribute("userId");
        logger.info("queryString={}, userId={}", queryString, userId);
        return "hello auth server!";
    }


}
